#ifndef _VL_PROP_WRITER__H_
#define _VL_PROP_WRITER__H_

#include <cstdint>
#include <cstddef>
#include <string>

namespace VL {

/**
 * @Author: CimZzz
 * @Date: 2023-03-08 19:18:31
 * 
 * 属性 Writer
 */
class VLPropWriter {
public:
	virtual ~VLPropWriter();
	template<class T>
	void write(const T& data, uint8_t byteSize) {
		for(uint8_t i = 0 ; i < byteSize ; i ++) {
			if(i == 0) {
				this->write(data & 0xFF);
			} else {
				this->write((data >> ((uint8_t)8 * i)) & 0xFF);
			}
		}
	}
	void writeStr(const char * fmt, ...);
	void writeStrWithSize(const std::string& str);
	virtual void write(const uint8_t& byte) = 0;
	virtual void writeBuf(const uint8_t* bytes, size_t length) = 0;
};

}

#endif // _VL_PROP_WRITER__H_
